;;;============================================================================
;;;
;;; Subject: Loading Simplicial Complexes Files
;;;         
;;;
;;;----------------------------------------------------------------------------
;;;
;;; Author: Jónathan Heras Vicente
;;;
;;;============================================================================

(IN-PACKAGE "COMMON-LISP-USER")

(DEFCONSTANT +SC-LIST+
    '("simplicial-complexes-optimize"
      "sc-to-ss"
      ))

(DO ((i 1 (1+ i))
     (mark +SC-LIST+ (cdr mark)))
    ((endp mark) (terpri))
   (format t "~% FILE ~2D: ~A" i (car mark)))

(DEFCONSTANT +SOURCE-EXTENSION-SC+
  #+(or allegro clisp lispworks) "cl"
  #-(or allegro clisp lispworks)
    (error "Not an Allegro or CLisp or LispWorks environment."))

(DEFCONSTANT +COMPILED-EXTENSION-SC+ 
    #+allegro "fasl"
    #+clisp "fas"
    #+lispworks "ofasl")

(DEFUN LOAD-SCFILES ()
   (mapc #'(lambda (file-name)
             (load (concatenate 'string file-name "." +SOURCE-EXTENSION-SC+)))
    +SC-LIST+))

(DEFVAR *CMBN-CONTROL-SC*)
(SETF *CMBN-CONTROL-SC* T)

(DEFUN COMPILE-SC-FILES ()
  (format t "~%*CMBN-CONTROL-SC*  = ~A~2%" *cmbn-control*)
  (mapc #'(lambda (file-name)
            (compile-file (concatenate 'string file-name "." +SOURCE-EXTENSION-SC+))
            (load (concatenate 'string file-name "." +compiled-extension-sc+)))
    +SC-LIST+))

(DEFUN LOAD-SC-FILES ()
   (mapc #'(lambda (file-name)
             (load (concatenate 'string file-name "." +compiled-extension-sc+)))
    +SC-LIST+))
